# -*- coding: utf-8 -*-
"""
@Time ： 2021/1/22 9:45
@Auth ： Mr. JJ_Cloud
@Company ：testingedu.com.cn
@Function ：连接VPN
"""
import os,time

start_directory = r'C:\Program Files (x86)\Cisco Systems\VPN Client\vpngui.exe'
os.startfile(start_directory)
time.sleep(3)

from pynput.keyboard import Controller,Key
c = Controller()
with c.pressed(Key.ctrl):
    c.press("O")
time.sleep(2)
c.type('ZRdjawLlCJP2ajWs')
time.sleep(2)
c.press(Key.enter)
time.sleep(5)
print(os.popen("ping 172.16.3.24").read())

# from pynput.mouse import Button,Controller
# mouse = Controller()

# 读取鼠标指针在屏幕上的位置
# print(f'当前鼠标指针的位置是：{mouse.position}')

# # 设置鼠标指针的位置
# mouse.position = (561, 314)
# print(f'将鼠标指针移动到 {mouse.position}')

# # 按下并释放鼠标左键
# mouse.press(Button.left)
# mouse.release(Button.left)

